/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vidu;

import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
import org.hibernate.Session;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import pojos.*;

/**
 *
 * @author tin
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        AnnotationConfiguration cfg = new AnnotationConfiguration();
        cfg.addAnnotatedClass(Thongtinvieclam.class);
        cfg.addAnnotatedClass(Nguoixacnhan.class);
        cfg.addAnnotatedClass(Hoso.class);
        cfg.configure();
        new SchemaExport(cfg).create(true, true);
        /*
        Session s = util.HibernateUtil.getSessionFactory().openSession();
        s.beginTransaction();

        pojos.Hoso hs = new Hoso();
        User u = new User();
        u.setTendangnhap("hoang");
        hs.setUser(u);
        hs.setMahoso("hs2");
        Set<Congviecmongmuon> cvmms = new HashSet(0);
        Congviecmongmuon cvmm = new Congviecmongmuon();
        CongviecmongmuonId cvid = new CongviecmongmuonId();
        cvid.setMacongviecmongmuon("cvmm1");
        cvid.setMahoso(hs.getMahoso());
        cvmm.setId(cvid);
        cvmm.setCongviec("ngồi chơi");
        cvmm.setHinhthuc("full-time");
        cvmm.setHoso(hs);
        cvmms.add(cvmm);
        hs.setCongviecmongmuons(cvmms);
        s.save(hs);
        s.getTransaction().commit();
         * 
         */
        System.out.println("okie");

    }
}
